package com.itheima.mapper;

import com.itheima.pojo.AddIntegral;
import com.itheima.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface UserMapper {
    @Select("select * from user where class_id=#{classId}")
    List<User> findAllStudentByClassId(Integer classId);

    @Select("select integral from user where  id=#{id}")
    Integer findStudentIntergral(Integer id);

    @Update("update user set integral = #{integral} where id = #{id};")
    int updateStudentIntegral(AddIntegral addIntegral);
}
